import Cookies from 'js-cookie'

const TokenKey = 'access_token'

export const getToken = () => {
  return Cookies.get(TokenKey)
}

export const setToken = (token) => {
  return Cookies.set(TokenKey, token)
}

export const setKey = (key, id) => {
  return Cookies.set(key, id)
}

export const getKey = (key) => {
  return Cookies.get(key)
}

export const removeToken = () => {
  Cookies.remove('userName')
  Cookies.remove('userId')
  return Cookies.remove(TokenKey)
}
